Skip to content

feat(impl_jni): add JCA AES-CBC implementation - #304

Merged
HamdaanAliQuatil merged 2 commits into
google:android-jca-branchfrom
mfazrinizar:feat/impl-jni-aes-cbc
Jul 12, 2026
Merged

feat(impl_jni): add JCA AES-CBC implementation#304
HamdaanAliQuatil merged 2 commits into
google:android-jca-branchfrom
mfazrinizar:feat/impl-jni-aes-cbc

Conversation

@mfazrinizar

@mfazrinizar mfazrinizar commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the JNI/JCA AES-CBC implementation on top of the existing Android JCA backend skeleton.

This PR implements:

  • AES-CBC raw key import/export
  • AES-CBC JWK import/export
  • AES-CBC key generation using the shared AES helper
  • byte and stream encryption/decryption
  • JCA Cipher("AES/CBC/PKCS5Padding") wiring with IvParameterSpec
  • focused desktop JNI tests
  • Android integration smoke test through the public API

PKCS5Padding is the JCA transformation name used for AES-CBC PKCS#7-style block padding.

Testing

For the desktop JNI-specific test, run this once first if JNI has not been set up locally:

  • dart run jni:setup

Verified with:

  • dart analyze
  • dart test test/impl_jni_aescbc_test.dart
  • dart test test/webcrypto_test.dart -p vm -n AES-CBC
  • flutter test integration_test/jni_aescbc_test.dart -d emulator-name

@mfazrinizar
mfazrinizar force-pushed the feat/impl-jni-aes-cbc branch 2 times, most recently from 618e863 to 63dfd42 Compare July 8, 2026 14:27
@mfazrinizar
mfazrinizar marked this pull request as ready for review July 8, 2026 14:28
@mfazrinizar
mfazrinizar force-pushed the feat/impl-jni-aes-cbc branch from 63dfd42 to 223bf40 Compare July 12, 2026 15:55
Comment thread lib/src/impl_jni/impl_jni.aescbc.dart Outdated
@HamdaanAliQuatil
HamdaanAliQuatil merged commit 98b3039 into google:android-jca-branch Jul 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants